﻿package com.scn.base.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.scn.base.dao.impl.DAOManager;
import com.scn.base.domain.SysLogVO;
import com.scn.base.util.QQWry;
import com.scn.base.page.PageVO;
import com.scn.base.service.ISysLogService;
@Service
public class SysLogServiceImpl implements ISysLogService {
	@Autowired
	private DAOManager daoManager;
	
	public void insertSysLog(int userno, String operate, String desc,
			String clienip, String sid) throws Exception {
		QQWry w = new QQWry();
		w.seek(clienip);
		String clientaddr=w.getCountry() + " " + w.getLocal();
		SysLogVO syslog=new SysLogVO();
		syslog.setSlclientaddr(clientaddr);
		syslog.setSlclientip(clienip);
		syslog.setSlodesc(desc);
		syslog.setSloperate(operate);
		syslog.setSlsid(sid);
		syslog.setSluser(userno);
		daoManager.getSysLogDao().insertSysLog(syslog);
	}
	public int selectSysLogCount(Map<String, String> param) {
		return daoManager.getSysLogDao().selectSysLogCount(param);
	}
	public List<SysLogVO> selectSysLogList(Map<String, String> param,PageVO page) {
		return daoManager.getSysLogDao().selectSysLogList(param,page);
	}

}
